home *** CD-ROM | disk | FTP | other *** search
- u
- J O H N N Y ' S T R I C K S
-
- by John "The Mad Gamer" Harris
-
-
- Now that I've encountered FAME AND
- FORTUNE as well as BIG BUCKS
- submitting programs to LOADSTAR,
- everyday-people-on-the-street are
- stopping me and telling me: 'You need
- a shave.' So I remind them of a few
- things. Like that I, John William
- Harris, am the VERY SAME JOHNNY WHO
- WROTE JOHNNY'S TRICKS!!! And the
- person, now understanding perfectly,
- calls the local Facility for the
- Mentally Disturbed. So I guess I'll
- have to submit another program before
- they come haul me away.
-
- This is a series of machine
- language routines designed for use in
- your own programs. In most cases, a
- quick SYS and a few parameters are all
- that it will take, and people will
- soon be stopping YOU on the street and
- telling YOU to shave.
-
- To use "tricks.o" in your BASIC
- program, just load the ML into place
- at $C000 (49152) with this line:
-
- sys57812"tricks.o",dv,0:poke780,0
- poke781,0:poke782,192:sys65493
-
- and all of the following tricks are
- at your disposal. Here are directions
- for each trick:
-
-
- [COPYROM]
- Address:49152
- Format:SYS 49152,CSS
- (CSS stands for Character Set
- Start.)
-
- What it does: Puts a copy of the ROM
- set starting at the address you
- specify. So, to copy the ROM set to
- 34816, the character set location used
- in the demo, just enter
- SYS49152,34816.
-
-
- [CLEARSET & RSTORSET]
- Addresses:49251 and 49277
- Format:SYS49251,CSS
- SYS49277,CSS
-
- By directly altering character
- memory, this makes it appear that all
- the characters on the screen are
- sliding off. RSTORSET does the
- opposite, making them slide back on.
- To use RSTORSET, you've got to use
- REMBRSET first. (see below)
-
-
- [FADEOUT & FADEIN]
- Addresses:49442 and 49477
- Format:SYS49442,CSS,speed
- SYS49477,CSS,speed
-
- Remember that nifty MIST routine that
- LOADSTAR's title screen used to use?
- This is a version for custom character
- sets. FADEOUT fades the set out, and
- FADEIN does the opposite. To use
- FADEIN, you've got to use REMBRSET
- first.
-
-
- [RVRSESET]
- Address:49674
- Format:SYS49674,CSS
-
- Simply reverses the set specified,
- turning it into a photographic
- negative of itself.
-
-
- [XORSET]
- Address:49722
- Format:SYS49722,CSS,number to be
- XORed
-
- Exclusive-ORs every byte in every
- character by the number you give.
- Thus, it's a little bit technical by
- definition. See the demo program for
- a few ways you can use it.
-
-
- *SCRWEDGE
- Address:49778
- Format:SYS49778,start in memory of
- the character in question,direction
-
- Think back to Jon Mattson's MAZE
- CHASE, published many centuries ago.
- Remember how you stared at that title
- screen, with it's moving grid
- background? While I'm not sure, I
- think this was how it was done. It
- wedges into the interrupt routine, and
- directly changes the graphics
- information for one character, whose
- start address you specify.
-
- This might not seem like much, but if
- you fill the whole screen with this
- character, like in the title screen
- for MAZE CHASE, it looks like the
- screen is scrolling without having to
- resort to any messy smooth scrolling
- routines. If you are using sprites,
- this is all you need to create an
- illusion of motion. The value for the
- 'direction' in the SYS statement works
- out like this:
-
- 1-scroll down
- 2-scroll up
- 4-scroll right
- 8 scroll left
-
- If you want to combine two
- directions, OR them together. (Up and
- left would be 2 OR 8, or 10.)
-
- Also, there are two additional
- features to this routine. By ORing
- the direction number by 16, you
- activate joystick mode. With this,
- when you push the joystick in port #2
- in a direction, the character will
- scroll in the OPPOSITE direction, so
- if you have, say, a spaceship on the
- screen, it looks like the ground,
- stars, etc. are passing by below you.
- If you provide sprites moving in the
- same direction, this effect might
- prove helpful in games.
-
- If you OR the direction number with
- 32, you activate flash mode, in which
- the wedge not only scrolls the
- character, but reverses it too. Since
- it does this every time the interrupt
- comes around, it looks like the
- screen's flashing. Great for
- explosions.
-
-
- [WEDGEOFF]
- Address:50009
- Format:SYS50009
-
- Turns off the wedge. (see above)
-
-
- [SPREDSET]
- Address:50022
- Format:SYS50022,CSS
-
- Widens stuff. It puts a pixel to the
- left and to the right of every pixel
- already on the screen every time you
- call it.
-
-
- [RUBSET]
- Address:50084
- Format:SYS50084,CSS
-
- I admit it, I couldn't think of a
- good name for this one. It sort of
- 'tears' everything apart. Most
- effective on a screen with a lot of
- reversed characters.
-
-
- [RTRVESET and REMBRSET]
- Addresses:50276 and 50301
- Format:SYS50276,CSS
- SYS50301,CSS
-
- Calling REMBRSET stores a copy of the
- set starting at the location you gave
- it in a 'buffer' starting at 51200.
- Routines that require a set to
- operate, like FADEIN and RSTORSET get
- the{SHIFT-*}information from here. Here's an
- example of how you use it.
-
- SYS REMBRSET,S1
- SYS FADEOUT,S1
- SYS R1,102
- SYS FADEIN,S1
-
- Assuming the VIC-II chip is expecting
- character information at S1, SYS
- REMBRSET,S1 stores a copy of the set
- in the buffer. SYS FADEOUT,S1 fades
- the screen to black, providing an
- eye-catching effect but destroying the
- current character set in the process.
- SYS R1,102 fills the screen with
- character 102 (the checkerboard
- pattern), and SYS FADEIN,S1 copies the
- stored character set from the buffer
- back into the current character set,
- one pixel at a time. Please note the
- SYS R1,102 command isn't nessesary.
-
-
- [SCREEN FILL]
- Address:50171
- Format:SYS50171,character number
-
- Fill the current screen, based on
- location 648, with the character you
- tell it to.
-
-
- [COLOR FILL]
- Address:50224
- Format:SYS50224,color number
-
- Puts the color you want in color
- memory (55296).
-
-
-
- Well, that's it. Of course, all
- of these things are demonstrated in
- the Demo program. You can either
- select something from the menu, or
- push a number key for a 'quickie'
- example. Another new feature is a
- display that shows the command syntax
- for each routine.
-
- And don't forget you don't really
- need a custom set for this program.
- You can simply copy the ROM set to a
- free area of memory, set the VIC-II
- registers to get the character info
- from there, and off you go. But if
- you do use a custom character set, to
- make sure nothing happens to it, load
- it into an unused area of memory and
- then copy it into place by
- REMBRSETing it and RETRVESETing it to
- the place VIC-II needs it. That way,
- if for some reason you destroy the
- copy, you don't have to reload it.
- Just make another copy.
-
- JH-TMG
-
-
-